home *** CD-ROM | disk | FTP | other *** search
/ Technotools / Technotools (Chestnut CD-ROM)(1993).ISO / lang_c / cppdll / fontsel.h < prev    next >
Text File  |  1990-02-14  |  4KB  |  52 lines

  1. /****************************************************************************
  2. *                                                                           *
  3. *                   Font Selector by A.P.Mazur Jun 15,1989                  *
  4. *                   APM Labs                                                *
  5. *                   511 Dix Way                                             *
  6. *                   San Jose, CA 95125                                      *
  7. *                   All rights reserved. Copyright 1989-1990.               *
  8. *                                                                           *
  9. *  This module allows the caller to select one of the fonts                 *
  10. *  available for given Display Context. SelectFont() function accepts       *
  11. *  five parameters:                                                         *
  12. *   hParent      : handle to a parent window                                *
  13. *                  When dialog is finished hParent is activated.            *
  14. *   hDC          : Caller supplied Display Context.                         *
  15. *                  Usualy hDC = GetDC(hParent)                              *
  16. *   pitch        : if set to FIXED_PITCH only fixed fonts are shown         *
  17. *                  if set to VARIABLE_PITCH  only variable fonts are shown  *
  18. *                  to see all fonts use FIXED_FONT | VARIABLE_FONT          *
  19. *   pFont        : pointer to the LOGFONT data structure. If the dialog     *
  20. *                  terminates with an OK message LOGFONT structure will be  *
  21. *                  filled with the current font description, otherwise the  *
  22. *                  LOGFONT structure remains unchanged.                     *
  23. *                  NOTE: Once APPLY action is performed a LOGFONT structure *
  24. *                  becomes permanently changed and CANCEL action is disabled*
  25. *   applyMessage : a message to be sent to the parent window in order to    *
  26. *                  notify about font change. If set to 0 no notification    *                                                                           *
  27. *                  takes place, otherwise a message :                       *
  28. *                    Send(hParent,WM_COMMAND,applyMessage,0L);              *
  29. *                  will be executed each time user changes a font.          *
  30. *                  NOTE: Sending notification disables a Cancel button.     * 
  31. *  SelectFont returns one of following codes:                               *
  32. *                                                                           *
  33. *    -1      : Insufficient memory to create the dialog box.                *
  34. *     1      : A new font was accepted by the user. The LOGFONT structure   *
  35. *              is updated.                                                  *
  36. *     2      : The dialog was  canceled by the user. The LOGFONT structure  *
  37. *              remains unchanged.                                           *
  38. *     3      : The Font Selector was "busy". Since a font selector is NOT   *
  39. *              reentrant it can't be used simultaneously with two windows.  *
  40. *              A second invocation will display a message box with the      *
  41. *              information on which application is using a Font Selector,   *
  42. *              when dissmised it will return 3.                             *
  43. *                                                                           *
  44. ****************************************************************************/
  45.              /* imports from fontsel.c module */
  46.  
  47. extern int  FAR PASCAL SelectFont(HWND  parentWindow,
  48.                                     HDC   hdc,
  49.                                     BYTE  pitch,
  50.                                     LOGFONT FAR *lpFont,
  51.                                   WORD applyMessage); 
  52.